﻿<phone:PhoneApplicationPage
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
	xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	x:Class="NUnitTestRunnerWP7.UnitTestsListPage"
	SupportedOrientations="Portrait" Orientation="Portrait"
	mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="480"
	shell:SystemTray.IsVisible="True">

	<!--<phone:PhoneApplicationPage.Resources>
		<viewModels:ResultsListViewModel x:Key="ResultsListViewModelDataSource" d:IsDataSource="True"/>
	</phone:PhoneApplicationPage.Resources> -->
	<!--LayoutRoot contains the root grid where all other page content is placed-->
	<Grid x:Name="LayoutRoot" Background="Transparent">
		<Grid.RowDefinitions>
			<RowDefinition Height="Auto"/>
			<RowDefinition Height="*"/>
		</Grid.RowDefinitions>

		<!--TitlePanel contains the name of the application and page title-->
		<StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="24,24,0,12">
			<TextBlock x:Name="ApplicationTitle" Text="NUnit Test Runner" Style="{StaticResource PhoneTextNormalStyle}"/>
			<TextBlock x:Name="PageTitle" Text="NUnit Tests" Margin="-3,-8,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
		</StackPanel>

		<!--ContentPanel - place additional content here-->
		<Grid x:Name="ContentGrid" Grid.Row="1" Margin="0,0,0,8"> <!-- d:DataContext="{Binding Source={StaticResource ResultsListViewModelDataSource}}"> --> 
			<Grid.ColumnDefinitions>
				<ColumnDefinition Width="0.5*"/>
				<ColumnDefinition Width="160"/>
				<ColumnDefinition Width="0.5*"/>
			</Grid.ColumnDefinitions>
			<Grid.RowDefinitions>
				<RowDefinition Height="0.825*"/>
				<RowDefinition Height="0.089*"/>
				<RowDefinition Height="0.086*"/>
			</Grid.RowDefinitions>
				<ListBox Margin="0"  x:Name="lstTests"
					Grid.ColumnSpan="3" 
					ItemsSource="{Binding Items, Mode=OneWay}"
					SelectionChanged="lstTests_SelectionChanged"
					ScrollViewer.HorizontalScrollBarVisibility="Auto"	 >
					<ListBox.ItemTemplate>
						<DataTemplate>
							<Grid Height="100" Width="479">
								<Grid.ColumnDefinitions>
									<ColumnDefinition Width="0.131*"/>
									<ColumnDefinition Width="0.222*"/>
									<ColumnDefinition Width="*"/>
								</Grid.ColumnDefinitions>
								<Grid.RowDefinitions>
									<RowDefinition Height="0.58*"/>
									<RowDefinition Height="0.42*"/>
								</Grid.RowDefinitions>
								<Image Grid.Column="0" Grid.RowSpan="2" x:Name="imgResultIcon" Width="32" Height="32" Source="{Binding ResultIcon}"/>
									<TextBlock 
										VerticalAlignment="Center"  
										Grid.Column="1" 
										Grid.Row="0" 
										Grid.ColumnSpan="2" 
										Margin="0,0,0,0" 											   
										Text="{Binding FullPath}" 
										TextWrapping="Wrap"
										FontSize="{StaticResource PhoneFontSizeMediumLarge}" 
									/>
								<TextBlock Grid.Column="1" Grid.Row="1" Margin="0,0,0,0" Text="{Binding Result}" FontSize="{StaticResource PhoneFontSizeNormal}" Foreground="{Binding ResultColor}"/>
								<StackPanel Grid.Column="2" Grid.Row="1" Orientation="Horizontal">
									<TextBlock Margin = "0,0,0,0" Text="{Binding ElapsedMilliseconds}" FontSize="{StaticResource PhoneFontSizeNormal}"/>
									<TextBlock Text=" ms" FontSize="{StaticResource PhoneFontSizeNormal}" />
								</StackPanel>
							</Grid>
						</DataTemplate>
					</ListBox.ItemTemplate>
				</ListBox>
			<ScrollViewer>
				
			</ScrollViewer>
				<StackPanel Grid.Column="0" Grid.Row="1" Orientation="Horizontal">
				<TextBlock Margin="10,0,0,0" Text = "Passed : " Foreground="GreenYellow" VerticalAlignment="Center" FontSize="26.667"/>
				<TextBlock Text="{Binding PassedCount, Mode=OneWay}" Foreground="GreenYellow" VerticalAlignment="Center" FontSize="26.667"/>
			</StackPanel>
			
			<StackPanel Grid.Column="1" Grid.Row="1" Orientation="Horizontal">
				<TextBlock Margin="10,0,0,0" Text = "Failed : " Foreground="Red" VerticalAlignment="Center" FontSize="26.667"/>
				<TextBlock Text="{Binding FailedCount, Mode=OneWay}" Foreground="Red" VerticalAlignment="Center" FontSize="26.667"/>
			</StackPanel>
				
			<StackPanel Grid.Column="2" Grid.Row="1" Orientation="Horizontal">
				<TextBlock Margin="10,0,0,0" Text = "Ignored : " Foreground="Orange" VerticalAlignment="Center" FontSize="26.667"/>
				<TextBlock Text="{Binding IgnoredCount, Mode=OneWay}" Foreground="Orange" VerticalAlignment="Center" FontSize="26.667"/>
			</StackPanel>

			<StackPanel Grid.Column="0" Grid.Row="2" Orientation="Horizontal">
				<TextBlock Margin="10,0,0,0" Text="{Binding TotalMilliseconds, Mode=OneWay}" Foreground="White" FontSize="{StaticResource PhoneFontSizeNormal}" VerticalAlignment="Center"/>
				<TextBlock Text = " ms" Foreground="White" VerticalAlignment="Center" FontSize="{StaticResource PhoneFontSizeNormal}"/>
			</StackPanel>

			<StackPanel Grid.Column="2" Grid.Row="2" Orientation="Horizontal">
				<TextBlock Margin="10,0,0,0" Text = "Total : " Foreground="White" VerticalAlignment="Center" FontSize="26.667"/>
				<TextBlock Text="{Binding TotalCount, Mode=OneWay}" Foreground="White" VerticalAlignment="Center" FontSize="26.667"/>
			</StackPanel>
		</Grid>
	</Grid>
</phone:PhoneApplicationPage>
